package com.wuyou.designPatterns.builder;

import com.wuyou.designPatterns.builder.framework.AbstractFootBuilder;
import com.wuyou.designPatterns.builder.framework.Document;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class BuilderMain {

    public static void main(String[] args) throws IOException {
        Director director = new Director(TextStringBuilder.getBuilder());
        director.construct();
        PrintWriter writer = new PrintWriter(new FileWriter("text1.txt"));
        writer.println(director.display());
        writer.close();


        DocumentDirector documentDirector = new DocumentDirector(new DocumentBuilder());
        Document construct = documentDirector.construct();
        PrintWriter writer1 = new PrintWriter(new FileWriter(construct.getFileName()+"."+construct.getFileType()));
        writer1.println(construct);
        writer1.close();
    }
}
